package cn.wu.jishupeizhi.controller;

import cn.wu.jishupeizhi.pojo.WhopList;
import cn.wu.jishupeizhi.service.WhopListService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/whoplist")
public class RedisTestController {
    @Autowired
    private WhopListService whopListService;

    @RequestMapping("/getall")
    public List<WhopList> getWhopList( ){
        List<WhopList> whopAll = whopListService.getWhopAll();
        return whopAll;
    }

    @RequestMapping("/login")
    public List<WhopList> login( ){
        List<WhopList> whopAll = whopListService.getWhopAll();
        return whopAll;
    }



    @RequestMapping("/getbyid")
    public WhopList getWhopById(Integer id){
        WhopList whopById = whopListService.getWhopById(id);
        return whopById;
    }

    @RequestMapping("/getbyid1")
    public WhopList getWhopById1(Integer id){
        WhopList whopById1 = whopListService.getWhopById1(id);
        return whopById1;
    }

    @RequestMapping("/getbyemail")
    public List<WhopList> getWhopByUser(String email){
        List<WhopList> whopByUser = whopListService.getWhopByUser(email);
        return whopByUser;
    }
}
